package com.hs.hlw.credit.system.business.dto;

import lombok.Data;
import org.hibernate.validator.constraints.NotBlank;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotNull;

/**
 * SubmissionFormDto
 * @author zhb
 * @date 2018/11/21
 */
public class SubmissionFormFieldDto {
    /** 文本输入. */
    @Data
    public static class Update1 {
        @NotNull(message = "未指定需更新的字段")
        private Integer id;
        @NotNull(message = "未指定控件类型")
        @Range(min = 1, max = 2, message = "控件类型指定有误")
        private Short type;
        @NotNull(message = "未指定文本行数")
        @Range(min = 1, max = 200, message = "文本行数须在1至200之间")
        private Integer rowCount;
        private String defaultValue;
        private String ruleDescription;
        @NotNull(message = "未指定是否校验")
        @Range(min = 0, max = 1, message = "是否校验指定有误")
        private Short checkStatus;
        private String regularExpression;
        private String errorMsg;
    }

    /** 数据输入. */
    @Data
    public static class Update2 {
        @NotNull(message = "未指定需更新的字段")
        private Integer id;
        private Double minValue;
        private Double maxValue;
        private String defaultValue;
        private String ruleDescription;
        @NotNull(message = "未指定是否校验")
        @Range(min = 0, max = 1, message = "是否校验指定有误")
        private Short checkStatus;
        private String regularExpression;
        private String errorMsg;
    }

    /** 维表选择. */
    @Data
    public static class Update3 {
        @NotNull(message = "未指定需更新的字段")
        private Integer id;
        @NotNull(message = "未指定控件类型")
        @Range(min = 1, max = 3, message = "控件类型指定有误")
        private Short type;
        @NotNull(message = "未指定是否多选")
        @Range(min = 0, max = 1, message = "是否多选指定有误")
        private Short multipleChoiceStatus;
        @NotNull(message = "未指定源据源配置")
        @Range(min = 1, max = 2, message = "数据源配置类型指定有误")
        private Short dataSourceType;
        @NotBlank(message = "未填写数据源配置内容")
        private String dataSourceContent;
        private Integer dataSourceId;
        private String defaultValue;
        private String ruleDescription;
        private String backFillLabel;
        private String backFillValue;
    }

    /** 日期选择. */
    @Data
    public static class Update4 {
        @NotNull(message = "未指定需更新的字段")
        private Integer id;
        @NotBlank(message = "日期格式未填写")
        private String dateFormat;
        private String defaultValue;
        private String ruleDescription;
    }
}